package src.main.java.org.properties;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

/*
 * 写属性文件
 * */
public class Test2 {
    public static void main(String[] args) throws Exception {
        Properties properties = new Properties();
        properties.setProperty("zhangwuji","000");
        properties.setProperty("zhangsan","123");
        properties.setProperty("lisi","12345");
        properties.setProperty("wangwu","123456");
        //存入到属性文件
        properties.store(new FileWriter("E:\\JavaLearn\\javaCode\\src\\users.properties"),
                "I saved user info");
    }
}
